
  $ . ./setup.sh
  $ cat > x.ml <<EOF
  > let sum = function a -> function b -> a + b
  > let sum2 = fun a -> fun b -> a + b
  > let sum3 = fun (a, b) -> fun c -> a + b + c
  > let sum4 = fun a -> fun b -> fun c -> a + b + c
  > EOF

  $ melc -drawlambda x.ml
  (setglobal X!
    (let
      (sum/271 =
         (function a/273[int] (function b/274[int] : int (+ a/273 b/274)))
       sum2/275 =
         (function a/277[int] (function b/278[int] : int (+ a/277 b/278)))
       sum3/279 =
         (function param/284
           (let
             (b/282 =a (field_imm :[]/1 param/284)
              a/281 =a (field_imm :[]/0 param/284))
             (function c/283[int] : int (+ (+ a/281 b/282) c/283))))
       sum4/285 =
         (function a/287[int]
           (function b/288[int]
             (function c/289[int] : int (+ (+ a/287 b/288) c/289)))))
      (makeblock 0module/exports sum/271 sum2/275 sum3/279 sum4/285)))
  // Generated by Melange
  'use strict';
  
  
  function sum(a, b) {
    return a + b | 0;
  }
  
  function sum2(a, b) {
    return a + b | 0;
  }
  
  function sum3(param) {
    const b = param[1];
    const a = param[0];
    return function (c) {
      return (a + b | 0) + c | 0;
    };
  }
  
  function sum4(a, b, c) {
    return (a + b | 0) + c | 0;
  }
  
  module.exports = {
    sum,
    sum2,
    sum3,
    sum4,
  }
  /* No side effect */


  $ cat > x.ml <<EOF
  > let sum_optional = fun ?a -> fun b -> (Option.value ~default:0 a) + b
  > let sum_optional_default = fun ?(a=2) -> fun b -> a + b
  > EOF

  $ melc -drawlambda x.ml
  (setglobal X!
    (let
      (sum_optional/271 =
         (function a/273
           (function b/274[int] : int
             (+ (apply (field_mut :value/2 (global Stdlib__Option!)) a/273 0)
               b/274)))
       sum_optional_default/292 =
         (function *opt*/296
           (let
             (a/294 =[int]
                (if (#is_not_none *opt*/296)
                  (#val_from_unnest_option *opt*/296) 2))
             (function b/295[int] : int (+ a/294 b/295)))))
      (makeblock 0module/exports sum_optional/271 sum_optional_default/292)))
  // Generated by Melange
  'use strict';
  
  const Stdlib__Option = require("melange/option.js");
  
  function sum_optional(a, b) {
    return Stdlib__Option.value(a, 0) + b | 0;
  }
  
  function sum_optional_default(aOpt, b) {
    const a = aOpt !== undefined ? aOpt : 2;
    return a + b | 0;
  }
  
  module.exports = {
    sum_optional,
    sum_optional_default,
  }
  /* No side effect */
